package com.zjb.example.provider;

import com.zjb.example.common.service.UserService;
import com.zjb.zjbrpc.RpcApplication;
import com.zjb.zjbrpc.config.RpcConfig;
import com.zjb.zjbrpc.server.HttpServer;
import com.zjb.zjbrpc.server.VertxHttpServer;
import com.zjb.zjbrpc.registry.LocalRegistry;
import com.zjb.zjbrpc.utils.ConfigUtils;


/**
 * 简易服务提供者示例
 */
public class EasyProviderExample {

    public static void main(String[] args) {
        //RPC框架初始化
        RpcConfig rpc = ConfigUtils.loadConfig(RpcConfig.class, "rpc");
        RpcApplication.init(rpc);

        //注册服务
        LocalRegistry.register(UserService.class.getName(), UserServiceImpl.class);

        // 启动 web 服务
        HttpServer httpServer = new VertxHttpServer();
        httpServer.doStart(8080);
    }
}
